import java.io.File;

public class DirectorySizeCalculator {

    public static void main(String[] args) {
        if (args.length > 0) {
            String directoryPath = args[0];
            File directory = new File(directoryPath);
            
            if (directory.isDirectory()) {
                long size = calculateDirectorySize(directory);
                System.out.println("Directory " + directoryPath + " occupies " + size + " bytes.");
            } else {
                System.out.println(directoryPath + " is not a directory.");
            }
        } else {
            System.out.println("Please provide a directory path.");
        }
    }

    private static long calculateDirectorySize(File directory) {
        long size = 0;
        File[] files = directory.listFiles();

        if (files != null) {
            for (File file : files) {
                if (file.isDirectory()) {
                    size += calculateDirectorySize(file); 
                } else {
                    size += file.length(); 
                }
            }
        }

        return size;
    }
}

